const notFind=()=>import(/* webpackChunkName: "404" */'pages/404/404.vue')
const home=()=>import(/* webpackChunkName: "home" */'pages/home/home.vue')
const login=()=>import(/* webpackChunkName: "login" */'pages/login/login.vue')
const register=()=>import(/* webpackChunkName: "register" */'pages/register/register.vue')
const search=()=>import(/* webpackChunkName: "search" */'pages/search/search.vue')
const shopcart=()=>import(/* webpackChunkName: "shopcart" */'pages/shopcart/shopcart.vue')
const detail=()=>import(/* webpackChunkName: "detail" */'pages/detail/detail.vue')
const addCartSuccess=()=>import(/* webpackChunkName: "addCartSuccess" */'pages/addCartSuccess/addCartSuccess.vue')
const info=()=>import(/* webpackChunkName: "info" */'pages/detail/info/info.vue')
const rule=()=>import(/* webpackChunkName: "rule" */'pages/detail/rule/rule.vue')
const after=()=>import(/* webpackChunkName: "after" */'pages/detail/after/after.vue')
const ratings=()=>import(/* webpackChunkName: "ratings" */'pages/detail/ratings/ratings.vue')
const phone=()=>import(/* webpackChunkName: "phone" */'pages/detail/phone/phone.vue')
const center=()=>import(/* webpackChunkName: "center" */'pages/center/center.vue')
const trade=()=>import(/* webpackChunkName: "trade" */'pages/trade/trade.vue')
const pay=()=>import(/* webpackChunkName: "pay" */'pages/pay/pay.vue')
const paysuccess=()=>import(/* webpackChunkName: "paysuccess" */'pages/paysuccess/paysuccess.vue')
const myOrder=()=>import(/* webpackChunkName: "myOrder" */'pages/center/myOrder/myOrder.vue')

export default[
    {
        name:'center',
        path:'/center',
        component:center,
        children:[
            {name:'center-myOrder',path:'myOrder',component:myOrder},
            {path:'',redirect:'myOrder'}
        ]
    },
    {
        name:'trade',
        path:'/trade',
        component:trade
    },
    {
        name:'pay',
        path:'/pay',
        component:pay,
        props:route=>({
            orderId:route.query.orderId
        })
    },
    {
        name:'paysuccess',
        path:'/paysuccess',
        component:paysuccess
    },
    {
        name:'addCartSuccess',
        path:'/addCartSuccess',
        component:addCartSuccess,
        props:route=>({
            num:route.query.num
        })
    },
    {
        name:'detail',
        path:'/detail/:id',
        component:detail,
        props:true,
        children:[
            {
                name:'detail-info',path:'info',component:info
            },
            {
                name:'detail-rule',path:'rule',component:rule
            },
            {
                name:'detail-after',path:'after',component:after
            },
            {
                name:'detail-ratings',path:'ratings',component:ratings
            },
            {
                name:'detail-phone',path:'phone',component:phone
            },
            {path:'',redirect:'info'}

        ]
    },
    {
        name:'login',
        path:'/login',
        component:login,
    meta:{
        hideFooter:true
    }
    },
    {
        name:'register',
        path:'/register',
        component:register,
        meta:{
            hideFooter:true
    }
    },
    {
        name:'search',
        path:'/search/:keyword?',
        component:search,
        props:$route=>({
            keyword:$route.params.keyword,
            category1Id:$route.params.category1Id,
            category2Id:$route.params.category2Id,
            category3Id:$route.params.category3Id,
            categoryName:$route.params.categoryName
        })
    },
    {
        name:'shopcart',
        path:'/shopcart',
        component:shopcart
    },
    {
        name:'home',
        path:'/home',
        component:home,
        meta:{
            showList:true
        }
    },
    {
        path:'/',
        redirect:'/home'
    },
    {
        name:'404',
        path:'/404',
        component:notFind,
        meta:{
            name:'404'
    }
    },
    {path:'*',redirect:'/404'}
]